﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<html>
<head runat="server">
    <title>后台登陆</title>
    <link type="text/css" href="css/style.css" rel="stylesheet" />
    <style type="text/css">
   body{overflow:hidden; position:absolute; top:0; right:0; left:0; bottom:0;}
    table{color:#00367F;}
    table a {text-decoration:underline;}
    table a:hover{text-decoration:none;}
    .body_top{position:absolute; height:42px; width:100%; top:0;background:url(images/logintop-bg.gif) repeat-x;}
    #Body{height:100%;overflow:hidden;padding-bottom:0;}
    html>body #Body{ height:auto; position:absolute; top:42px; bottom:0; width:100%;}
    .loginDiv{position:absolute; width:240px; height:150px; left:50%; top:50%; margin:-80px 0 0 -120px;}
    .title{ height:30px;font-weight:bold;font-size:14px;text-align:center}
    </style>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="js/lib.js"></script>
</head>
<body>
    <form id="form1" runat="server" style="height: 100%" defaultbutton="btnSubmit">
        <div class="body_top">
        </div>
        <div id="Body">
            <div class="loginDiv">
                <table>
                    <tr>
                        <td colspan="4" class="title">
                            管理员登陆
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50px">
                            用户名：</td>
                        <td colspan="3">
                            <asp:TextBox ID="txtUserName" runat="server" CssClass="txtbox"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>
                            密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
                        <td colspan="3">
                            <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" CssClass="txtbox"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>
                            验证码：</td>
                        <td valign="middle" style="width: 60px">
                            <asp:TextBox ID="txtCode" runat="server" Width="60" CssClass="txtbox"></asp:TextBox></td>
                        <td align="left" style="width: 50px">
                            <img onclick="changeImageChallenge()" id="imgValidateCode" src="../ValidateCode.aspx"
                                class="validatecode" alt="点击换张图片" /></td>
                        <td align="left">
                            <a href="javascript:void(0)" onclick="changeImageChallenge()">换一张</a></td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td colspan="3" align="left" style="height: 30px;">
                            <asp:Button ID="btnSubmit" runat="server" Text="登 陆" OnClientClick="return CheckInput();"
                                OnClick="btnSubmit_Click" CssClass="button" />
                            <input type="reset" class="button" value="重 置" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
    <script type="text/javascript">
        $(function(){$('#txtUserName').focus();})
        function CheckInput(){
            if($.isEmpty($("#txtUserName").val())){
                alert("请输入用户名！");
                $("#txtUserName").focus();
                return false;
            }
            if($.isEmpty($("#txtPassword").val())){
                alert("请输入密码！");
                $("#txtPassword").focus();
                return false;
            }
            if($.isEmpty($("#txtCode").val())){
                alert("请输入验证码！");
                $("#txtCode").focus();
                return false;
            }
            return true;
        }
        function changeImageChallenge(){
           var now = new Date();
           $("#imgValidateCode").attr("src","../ValidateCode.aspx?t"+now.getTime());
       }
    </script>
</body>
</html>
